package org.cloud.admin.auth.client.fallbackfactory;

import org.cloud.admin.auth.client.client.SysAuthClient;
import org.cloud.common.model.R;

import feign.hystrix.FallbackFactory;

/**
 * 
 * @author wangyuan
 * @since 2019年6月5日 下午4:07:13
 *
 */
public class SysAuthClientFallbackFactory implements FallbackFactory<SysAuthClient> {

	@Override
	public SysAuthClient create(Throwable cause) {
		return new SysAuthClient() {
			
			@Override
			public R authenticateService(String accessToken, String requestUri) {
				return R.error("请求错误，原因为：" + cause.getMessage());
			}
		};
	}

}
